import os

""" 
设置 CUDA 环境变量,该项为后加的代码，线上可去除。
"""
# CUDA_PATH = r'D:\cuda_document\download\development_0307'  # 实际的 CUDA 安装路径
# os.environ['CUDA_PATH'] = CUDA_PATH
# os.environ['CUDA_HOME'] = CUDA_PATH
# os.environ['PATH'] = os.environ['PATH'] + f';{CUDA_PATH}\\bin;{CUDA_PATH}\\lib\\x64'

class Config:
    SECRET_KEY = os.urandom(24)
    # SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://nursing_actions:cxy123456@8.134.160.187:10020/nursing_actions'
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:1234@127.0.0.1:3308/nursing_03_29'
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_POOL_SIZE = 10
    SQLALCHEMY_POOL_TIMEOUT = 30
    SQLALCHEMY_POOL_RECYCLE = 1800
    MAX_DAILY_WORK_HOURS = 24  # 护理员每天最大工作时数
    MIN_REST_BETWEEN_SHIFTS = 2  # 两个班次之间的最小休息时间（小时）

    # Redis配置
    # REDIS_HOST = os.environ.get('REDIS_HOST', '8.134.160.187')
    # REDIS_PORT = int(os.environ.get('REDIS_PORT', 1968))  # 端口号
    # REDIS_DB = int(os.environ.get('REDIS_DB', 0))
    REDIS_HOST = os.environ.get('REDIS_HOST', '127.0.0.1')
    REDIS_PORT = int(os.environ.get('REDIS_PORT', 6379))  # 端口号
    REDIS_DB = int(os.environ.get('REDIS_DB', 3))
    REDIS_PASSWORD = os.environ.get('REDIS_PASSWORD', '123456')
    REDIS_UPDATE_KEY = 'update'

    # 添加 GPU 相关配置
    USE_GPU = True
    GPU_DEVICE = 0

